package com.schedualnew.mq.config;

import cn.hutool.json.JSONUtil;
import com.schedualnew.mq.dto.esb.ESBEntry;
import com.schedualnew.mq.service.MQClientService;
import com.schedualnew.mq.util.JacksonUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

//public class PrepareProgressApplicationRunner implements ApplicationRunner {
//
//    private Logger logger = LogManager.getLogger(PrepareProgressApplicationRunner.class);
//
//    @Autowired
//    private MQClientService mqClientService;
//
//    @Autowired
//    private AppParamsConfig paramsConfig;
//
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        mqClientService.listenReceiveMessage(paramsConfig.getListenExaminationStatusChangeMMQ(),
//                paramsConfig.getChangeExaminationStatusManageMQ(),
//                paramsConfig.getSourceSystemCode(), entity -> {
//
//                    ESBEntry esbEntry = JacksonUtil.readValue(entity.getMsg(), ESBEntry.class);
//
//                    logger.info(JSONUtil.toJsonStr(entity));
//                });
//
//    }
//}
